<!DOCTYPE html>
<title>Element#requestFullscreen({ screen }) tentative support</title>
<!-- TODO: update link to W3C whenever specifications are ready -->
<link rel="help" href="https://github.com/webscreens/window-placement"/>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async t => {
  // Grant window-placement permissions for testdriver.
  await test_driver.set_permission({name: "window-placement"}, "granted");

  let invoked = false;
  let options = { get screen() { invoked = true; return undefined; } };
  return document.body.requestFullscreen(options).then(
    () => { assert_unreached("promise unexpectedly fulfilled"); },
    () => { assert_true(invoked, "screen getter not invoked"); });
}, "fullscreenOptions.screen getter is invoked on requestFullscreen");
</script>
